import { qiankunWindow } from "vite-plugin-qiankun/dist/helper";
import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/home",
    component: () => import("@/pages/home/index.vue"),
  },
  {
    path: "/home1",
    // component: () => import("@/pages/home1/index.vue"),
    children: [
      {
        path: "child1",
        component: () => import("@/pages/child1/index.vue"),
      },
    ],
  },
];

export const router = createRouter({
  history: createWebHistory(qiankunWindow.__POWERED_BY_QIANKUN__ ? "/" : "/"), // hash 模式用 createWebHashHistory()
  routes,
});
